package com.cy1;

import java.util.Collection;
import java.util.HashMap;
import java.util.Set;

public class MapDemo2 {
    public static void main(String[] args) {
        HashMap<String, String> map = new HashMap<>();
        map.put("chenyong","meilv");
        map.put("shuangge","shi chenyong");
        map.put("yuanxiang","aichneyong");
        System.out.println(map.get("chenyong"));

        Set<String> key = map.keySet();
        for (String s : key) {
            System.out.println(s);
        }
        Collection<String> values = map.values();
        for (String value : values) {
            System.out.println(value);
        }

    }
}
